<style>
td {
	border: solid #68BADA;
	border-width: 0px 1px 1px 0px;
	padding: 5px;
	text-align: center
}
table {
	border: solid #68BADA;
	border-width: 1px 0px 0px 1px;
}
.odd {
	background: none repeat scroll 0 0 #EEEEEE;
}
.even {
	background: none repeat scroll 0 0 #FFFFFF;
}
.three {
	background: none repeat scroll 0 0 #E5F1F4;
}
.jg {
	background: none repeat scroll 0 0 #ADD9ED;
}
.head {
	background: none repeat scroll 0 0 #90D8F0;
}
input, img {
	vertical-align: middle;
}
</style>
<?php
$this->breadcrumbs=array(
	'會員列表'=>array('index'),
	'會員列表',
);
?>
<div style="width:100%; float:left; margin-bottom:10px; text-align:right;">
	<form action="<?=Yii::app()->createUrl('user/index')?>" name="jobForm" id="jobForm" method="get">		
		創建時間:
		<input type="text" name="s" id="s" value="<?= $search['s'] ?>" readonly="readonly" style="width:88px;" />
		<img onclick="displayCalendar(document.jobForm.s,'yyyy-mm-dd',this)" style="cursor:pointer;" src="images/calendar.png" /> - 
		<input type="text" name="e" id="e" value="<?= $search['e'] ?>" readonly="readonly" style="width:88px;" />
		<img onclick="displayCalendar(document.jobForm.e,'yyyy-mm-dd',this)" style="cursor:pointer;" src="images/calendar.png" />
		<?php echo CHtml::dropDownList('searchtype',$search['searchtype'], Yii::app()->params['usersearchtype']);?>
		<?php echo CHtml::dropDownList('userstatus',$search['userstatus'], Yii::app()->params['userstatus']);?>
		： <input type="text" name="key" value="<?php if(isset($search['key']))echo $search['key'];?>" id="oid" size="10" />
		<input type="image" src="images/go.png" id="jobSub" />
		<input type="hidden" name="r" value="user/index" />
	</form>
</div>
<table cellspacing="0" cellpadding="0" width="100%" class="tbl">
	<tr class="head">
		<td width="5%">UID</td>
		<td width="12%">帳號</td>
		<td width="8%">姓名</td>
		<td width="10%">身份証號碼</td>
		<td width="18%">E-mail</td>
		<td width="10%">手機</td>
		<td width="5%">狀態</td>
		<td width="16%">創建時間</td>
		<td>操作</td>
	</tr>
	<?php
    $i = 0;
    $cssArr = array(0 => 'even', 1 => 'odd', 2 => 'three');
    foreach ($rowTable as $item) {
        $trClass = $cssArr[$i % 3];
        $i++;
		if($item->status==1){
			$msg = '停用';
		}else{
			$msg = '正常';
		}
    ?>
	<tr class="<?= $trClass ?>">
		<td>
			<?=$item->uid?>
		</td>
		<td>
			<?=$item->username?>
		</td>
		<td>
			<?=$item->realname?>
		</td>
		<td>
			<?=$item->idcard?>
		</td>
		<td>
			<?=$item->email?>
		</td>
		<td>
			<?=$item->mobile?>
		</td>
		<td>
			<?=Yii::app()->params['userstatus'][$item->status]?>
		</td>

		<td>
			<?=$item['dateline']?>
		</td>
		<td>
			<a title="瀏覽" href="<?=Yii::app()->createUrl('user/view',array('id'=>$item->uid))?>"><img alt="瀏覽" src="/admin/images/zoomin.png"></a>
			<a title="編輯" href="<?=Yii::app()->createUrl('user/update',array('id'=>$item->uid))?>"><img alt="編輯" src="/admin/images/edit.png"></a>
			<a title="重置密碼" onclick="return confirm('確定要重置密碼?')" href="<?=Yii::app()->createUrl('user/setPwd',array('id'=>$item->uid))?>"><img alt="重置密碼" src="/admin/images/work.png"></a>
			<a title="停用/啟用" onclick="return confirm('確定要修改用戶狀態為：<?=$msg?>')" href="<?=Yii::app()->createUrl('user/stop',array('id'=>$item->uid))?>"><img alt="停用/啟用" src="/admin/images/up.png"></a>
		</td>
	</tr>
	<?php
    }
    ?>
</table>
<div id="pager" align="center">
	<?php  
	$this->widget('CLinkPager',array(  
		'header'=>'',  
		'firstPageLabel' => '<<',
		'lastPageLabel' => '>>',
		'prevPageLabel' => '<',
		'nextPageLabel' => '>',
		'pages' => $pages,  
		'maxButtonCount'=>13  
		));  
?>
</div>
